
package dieci.managers.rawmaterial;

import dieci.database.rawmaterial.OrderRawMaterialHibernateDAO;
import dieci.system.OrderRawMaterial;
import java.util.Date;
import java.util.List;

/**
 *
 * @author DuckSys
 */
public class OrderRawMaterialManager {

    public OrderRawMaterialManager()
    {
        this.orderRawMaterialDAO = new OrderRawMaterialHibernateDAO();
    }

    public void saveOrderRawMaterial(OrderRawMaterial orderRawMaterial)
    {
        //call dao to save the orderRawMaterial in db
        orderRawMaterialDAO.saveOrUpdate(orderRawMaterial);        
    }

    
    public void deleteOrderRawMaterial(OrderRawMaterial orderRawMaterial)
    {
        orderRawMaterialDAO.delete(orderRawMaterial);
    }

    public OrderRawMaterial find(long orderRawMaterialId)
    {
        return orderRawMaterialDAO.findByOrderRawMaterialId(orderRawMaterialId);
    }
    
    public List<OrderRawMaterial> list()
    {
        return orderRawMaterialDAO.list();
    }
    
    public List<OrderRawMaterial> findByDateRange(Date from, Date end)
    {
        return orderRawMaterialDAO.findByOrderRawMaterialDateRange(from,end);
    }
    
    public List<OrderRawMaterial> findBySupplier(String supplierName)
    {
        return orderRawMaterialDAO.findBySupplierName(supplierName);
    }
    private OrderRawMaterialHibernateDAO orderRawMaterialDAO;
}
